import request from '@/utils/request'
import type { LoginForm, LoginResult } from '@/types/auth'

export function login(data: LoginForm) {
  return request<LoginResult>({
    url: '/auth/login',
    method: 'post',
    data,
  })
}

export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post',
  })
}

export function getUserInfo() {
  return request({
    url: '/auth/info',
    method: 'get',
  })
}
